Cevela about COBOL COBOL language - Home - Site Map - About Cevela - MX COBOL    <prev   next>
5.   Statements for sorting files
For more see links to the main provider's on-line documentation.
For MX COBOL see Summary comment + FAQ and How to ..

Common structure

                                                                 68-1
object-computer.
   sequence  Abc-1.
special-names.
   alphabet  Abc-1  Char-1 thru Char-2  .
                    Char-3 ...
file-control.
   select  File-1
      assign  Dev-1.
file section.
sd  File-1.
1   Rec-1.
 2   Dat-2  data-spec*
 2   Dat-3  data-spec*
 2   ..
procedure division.
   ..
   sort  File-1
      key-spec*
         ascending Dat-2  ...
         descending Dat-3  ...
      [duplicates]
      [sequence  Abc-1]
      input-spec*
         / input procedure  Proc-2
         / using  File-2  ...
      output-spec*
         / output procedure  Proc-3
         / giving  File-3  ...
   ..
Proc-2.
   ..  release Rec-1  ..
Proc-3.
   ..  return File-1  ..

data-spec* see Data formats

sort

                                                                 68-1
sort  File-1
   key-spec*
      ascending Dat-2  ...
      descending Dat-3  ...
   [duplicates]
   [sequence  Abc-1]
   input-spec*
      / input procedure  Proc-2
      / using  File-2  ...
   output-spec*
      / output procedure  Proc-3
      / giving  File-3  ...

MX limitations: - it can be only one sort statement in the program - phrases duplicates, sequence are not implemented

release

                                                                 68-1
release  Rec-1  [from  Dat-2]
                       Lit-2
    

return

                                                                 68-1
return  File-1  [into  Dat-2]
   end
      imperative-statements-3*
   [not end                                                      85-1
      imperative-statements-4*]
end-of-statement*
   end-return
   .

MX limitations: - the phrases not end, end-return are not implemented - see How to in MX

COBOL language in brief - © Vlastimil Cevela 2006

Date 2006-06-03 - Text Builder 0.65 - Time 20:31:36